/***********************************************************************************************************************************
 *    Name: 
 *  Author: Frank Figearo — http://www.sqlnerd.me/ — frank@sqlnerd.me
 * Summary: 
**/
SELECT N'SetSPN -s MSSQLSvc/' + sl.ServerName + N':1433 BBAAviation\SQLTestService' FROM dbo.ServerList sl WHERE sl.Category LIKE N'%» Test/QA' AND sl.ServerName = sl.HostName ORDER BY sl.ServerName;

SELECT N'SetSPN -s MSSQLSvc/' + sl.ServerName + N':1433 BBAAviation\SQLStageService' FROM dbo.ServerList sl WHERE sl.Category LIKE N'%» Staging' AND sl.ServerName = sl.HostName ORDER BY sl.ServerName;

SELECT N'SetSPN -s MSSQLSvc/' + sl.ServerName + N':1433 BBAAviation\SQLProdService' FROM dbo.ServerList sl WHERE sl.Category LIKE N'%» Production' AND sl.ServerName = sl.HostName ORDER BY sl.ServerName;
